//
//  NoDataView.m
//  Toyota
//
//  Created by ld on 2024/6/26.
//

#import "NoDataView.h"
#import "Definition.h"
#import "Helper.h"
@implementation NoDataView

- (void)hasImg:(BOOL)hasImg andTitleStr:(NSString *)titleStr andImgStr:(NSString *)imgStr andHeight:(CGFloat)heightH{
    [self channelSetupViewHasImg:hasImg andTitleStr:titleStr andImgStr:imgStr andHeight:heightH];
}

- (void)channelSetupViewHasImg:(BOOL)hasImg andTitleStr:(NSString *)titleStr andImgStr:(NSString *)imgStr andHeight:(CGFloat)heightH{
    self.backgroundColor = [UIColor whiteColor];
    float h = heightH;
    if (hasImg) {
        UIImageView * img = [[UIImageView alloc]initWithFrame:CGRectMake((self.customWidth - 150) / 2., h, 150, 150)];
        img.image = [UIImage imageNamed:imgStr];
        [self addSubview:img];
        
        h = img.customBottom + 25;
    }
    
    UILabel * titleStrLab = [[UILabel alloc]initWithFrame:CGRectMake(0, h, self.customWidth, 18)];
    titleStrLab.text = titleStr;
    titleStrLab.textColor = kColor969696;
    titleStrLab.font = fontSize(14);
    titleStrLab.textAlignment = NSTextAlignmentCenter;
    [self addSubview:titleStrLab];
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
